<!DOCTYPE html>
<html>
   <head>
      <title>浙江中兴个人信息</title>
      <meta name="viewport" content="width=device-width, initial-scale=1.0 Access-Control-Allow-Origin:*">
      <!-- 引入 Bootstrap -->
      <!--<link href="<?=base_url('html/bootstrap_v3/css/bootstrap.css')?>" rel="stylesheet">-->
      <link href="<?=base_url('html/bootstrap_v3/css/bootstrap.css')?>" rel="stylesheet">
      <link href="<?=base_url('html/bootstrap_v3/datepicker/css/bootstrap-datetimepicker.min.css')?>" rel="stylesheet">
      <!--<link href="<?=base_url('html/bootstrap_v3/css/bootstrap-glyphicons.css')?>" rel="stylesheet">-->
      <script src="<?=base_url('html/js/jquery-1.8.3.min.js')?>"></script>
      <script src="<?=base_url('html/bootstrap_v3/js/bootstrap.min.js')?>"></script>
      <script src="<?=base_url('html/bootstrap_v3/datepicker/js/bootstrap-datetimepicker.js')?>"></script>
      <script src="<?=base_url('html/bootstrap_v3/datepicker/js/locales/bootstrap-datetimepicker.zh-CN.js')?>"></script>
      
      <!-- HTML5 Shim 和 Respond.js 用于让 IE8 支持 HTML5元素和媒体查询 -->
      <!-- 注意： 如果通过 file://  引入 Respond.js 文件，则该文件无法起效果 -->
      <!--[if lt IE 9]>
         <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
         <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
      <![endif]-->
      <style type="text/css">
          .body{background-color: #f5f5f5;}
          .showimg{background: url("../html/image/PersonInfo.png") center repeat;height:12em; margin-bottom:20px;}
          .margin_left{margin-left: 0.3em;}
          .margin_right{margin-right: 0.5em;}
          .float-right{float: right;}
          .small{height: 20px;width: 20px;}
          .page_edit{display: none;}
          .margin-bottom30{margin-bottom: 20px;}
      </style>
   </head>
   <body>
   <input type="text" value="<?=$userno?>" id="userno" style="display:none">
       <div class="showimg"></div>
        <div class="list-group">
               <a href="#" class="list-group-item active">个人基本信息</a>
               <div class="list-group-item">
                   <span class="margin_left">姓名</span><span class="margin_right float-right"><?=$username?></span>
               </div>
               <div class="list-group-item">
                   <span class="margin_left">工号</span><span class="margin_right float-right"><?=$userno?></span>
               </div>
               <div class="list-group-item">
                   <span class="margin_left">公司单位</span><span class="margin_right float-right"><?=$comp?></span>
               </div>
               <div class="list-group-item">
                   <span class="margin_left">部门</span><span class="margin_right float-right"><?=$dept?></span>
               </div>
               <div class="list-group-item">
                   <span class="margin_left">岗位名称</span><span class="margin_right float-right"><?=$station?></span>
               </div>
               <div class="list-group-item">
                   <span class="margin_left">职等</span><span class="margin_right float-right"><?=$post?></span>
               </div>
               <div class="list-group-item">
                   <span class="margin_left">入职时间</span><span class="margin_right float-right"><?=$entry?></span>
               </div>
               <div class="list-group-item">
                   <span class="margin_left">集团工龄</span><span class="margin_right float-right"><?=$gongling?></span>
               </div>
               <div class="list-group-item">
                   <span class="margin_left">联系电话</span><img src="../html/icon/iconfont-more.svg" class="small float-right page_show"><span class="margin_right float-right page_show"><?=$usertel?></span><input type="text" name="usertel" value="<?=$usertel?>" id="usertel" class="page_edit float-right">
               </div>
               <div class="list-group-item">
                   <span class="margin_left">E-Mail</span><img src="../html/icon/iconfont-more.svg" class="small float-right page_show"><span class="margin_right float-right page_show"><?=$email?></span><input type="text" name="email" value="<?=$email?>" id="email" class="page_edit float-right">
               </div>
               <div class="list-group-item">
                   <span class="margin_left">家庭地址</span><img src="../html/icon/iconfont-more.svg" class="small float-right page_show"><span class="margin_right float-right page_show"><?=$useraddress?></span><input type="text" name="useraddress" value="<?=$useraddress?>" id="useraddress" class="page_edit float-right">
               </div>
       </div>
       <div class="list-group">
            <a href="#" class="list-group-item active">父母信息</a>
            <div class="list-group-item">
                <span class="margin_left">父亲姓名</span><img src="../html/icon/iconfont-more.svg" class="small float-right page_show"><span class="margin_right float-right page_show"><?=$fatherName?></span><input type="text" name="fatherName" value="<?=$fatherName?>" id="fatherName" class="page_edit float-right">
            </div>
            <div class="list-group-item">
                <span class="margin_left">父亲生日</span><img src="../html/icon/iconfont-more.svg" class="small float-right page_show"><span class="margin_right float-right page_show"><?=$fatherBirth?></span><input type='text' name='fatherBirth' value='<?=$fatherBirth?>' id='fatherBirth'  class="page_edit float-right">
            </div>
            <div class="list-group-item">
                <span class="margin_left">母亲姓名</span><img src="../html/icon/iconfont-more.svg" class="small float-right page_show"><span class="margin_right float-right page_show"><?=$motherName?></span><input type="text" name="motherName" value="<?=$motherName?>" id="motherName" class="page_edit float-right">
            </div>
            <div class="list-group-item">
                <span class="margin_left">母亲生日</span><img src="../html/icon/iconfont-more.svg" class="small float-right page_show"><span class="margin_right float-right page_show"><?=$motherBirth?></span><input type="text" name="motherBirth" value="<?=$motherBirth?>" id='motherBirth' class="page_edit float-right">
            </div>
            <div class="list-group-item">
                <span class="margin_left">父母电话</span><img src="../html/icon/iconfont-more.svg" class="small float-right page_show"><span class="margin_right float-right page_show"><?=$tel?></span><input type="text" name="tel" value="<?=$tel?>" id="tel" class="page_edit float-right">
            </div>
            <div class="list-group-item">
                <span class="margin_left">父母地址</span><img src="../html/icon/iconfont-more.svg" class="small float-right page_show"><span class="margin_right float-right page_show"><?=$address?></span><input type="text" name="address" value="<?=$address?>" id="address" class="page_edit float-right">
            </div>
       </div>
       <div class="edit margin-bottom30">
            <button type="button" class="btn btn-primary btn-block">
                修改
            </button>
       </div>
       <div class="editbutton" style="display:none; margin-bottom:  75px">
           <div class="col-md-6 col-xs-6 col-sm-6">
               <button type="button" class="btn btn-default btn-block back">
                返回
                </button>
           </div>
           <div class="col-md-6 col-xs-6 col-sm-6">
               <button type="button" class="btn btn-primary btn-block submit">
                确定
                </button>
           </div>
           
       </div>
       <script>
           $(document).ready(function(){
               $(".edit").click(function(){
                   $(".editbutton").css("display","block");
                   $(".edit").css("display","none");
                   $(".page_show").css("display","none");
                   $(".page_edit").css("display","block");
               });
               $(".back").click(function(){
                   $(".editbutton").css("display","none");
                   $(".edit").css("display","block");
                   $(".page_show").css("display","block");
                   $(".page_edit").css("display","none");
               });
               $(".submit").click(function(){
                   var userno       = $("#userno").val();
                   var usertel      = $("#usertel").val();
                   var email        = $("#email").val();
                   var useraddress  = $("#useraddress").val();
                   var fatherName   = $("#fatherName").val();
                   var fatherBirth  = $("#fatherBirth").val();
                   var motherName   = $("#motherName").val();
                   var motherBirth  = $("#motherBirth").val();
                   var tel          = $("#tel").val();
                   var address      = $("#address").val();
				   $.ajax({
                       type:"GET",
                       url:"<?=base_url()?>/PersonInfo/update?userno="+userno+"&usertel="+usertel+"&email="+email+"&useraddress="+useraddress+"&fatherName="+fatherName+"&fatherBirth="+fatherBirth+"&motherName="+motherName+"&motherBirth="+motherBirth+"&tel="+tel+"&address="+address,
                       success:function(data){
                           //alert(data);
						   window.location.href="<?=base_url()?>/personinfo/updateSuccess?userid="+userno;
                       },
					    error: function(XMLHttpRequest, textStatus, errorThrown) {
							//alert(XMLHttpRequest.status);
							//alert(XMLHttpRequest.readyState);
							//alert(textStatus);
							alert("您更新的信息有误，请重新确认或联系管理员！");
						}
                   });
               });
           })
           
       </script>
       <script type="text/javascript">
            $('#fatherBirth').datetimepicker({
              minView:"month",
              format:'yyyy/mm/dd',
              language: 'zh-CN',
              weekStart: 1,
              todayBtn: 1,
              autoclose: 1,
              todayHighlight: 1,
              startView: 2,
              forceParse: 0,
              showMeridian: 1
            });
            
            $('#motherBirth').datetimepicker({
              minView:"month",
              format:'yyyy/mm/dd',
              language: 'zh-CN',
              weekStart: 1,
              todayBtn: 1,
              autoclose: 1,
              todayHighlight: 1,
              startView: 2,
              forceParse: 0,
              showMeridian: 1
            });
    </script>
   </body>
</html>